/*
 *@Author: 张楚
 *@Date: 2021-08-03 13:41:13
 *@Description: 通用按钮
*/

import 'package:flutter/material.dart';

class BtnItem extends StatelessWidget {
  final String content;
  final Function callback;

  const BtnItem({Key key, this.content, this.callback}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(top: 10, left: 20, right: 20),
      child: Ink(
        decoration: BoxDecoration(
          ///设置渐变
          // gradient: LinearGradient(
          //   // begin: Alignment.topLeft,
          //   // end: Alignment.bottomRight,
          //   // colors: [Color(0xffFFBA13), Color(0xffFFBA13)]
          // ),
          color: Color(0xffFFBA13),
          borderRadius: BorderRadius.circular(20),
        ),
        child: InkWell(
          splashColor: Colors.blue,
          borderRadius: BorderRadius.circular(20),
          onTap: callback,
          child: Container(
            height: 40,
            child: Center(
              child: Text(
                content,
                style: Theme.of(context)
                    .textTheme
                    .headline6
                    .copyWith(fontSize: 15),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
